Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editionable worldwide organisation logo formatted name #8684

Merged
merged 6 commits into from
Jan 2, 2024

Conversation

jkempster34
Copy link
Contributor

https://trello.com/c/12wQrTlH

Add title method to worldwide organisation

The new editionable worldwide organisation model uses the title method
instead of name.

This adds title to the legacy worldwide organisation model so that views and
helpers etc. can be compatible with both model types.

Use the worldwide_organisation document type

We don't need a new document type here, we can use the existing one.

Add logo formatted name to editions

This is required for editionable worldwide organisations.

Present logo formatted title for worldwide organisations

These have been broken for some time. They remained broken when the rendering
of these pages was moved to Government Frontend.

Presenting these correctly will allow us to fix them on the frontend and
restore their proper functionality.

Present logo formatted name for editionable worldwide organisations

The presenter isn't currently valid against the schema because it's missing the
logo formatted name.

Add logo formatted name textarea for editionable worldwide organisations

This allows users to add a logo formatted name for the new editionable
worldwide organisations.

image


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@jkempster34 jkempster34 changed the title Ww org logo formatted name Editionable worldwide organisation logo formatted name Dec 29, 2023
@jkempster34 jkempster34 marked this pull request as ready for review December 29, 2023 13:58
},
},
document_type: item.class.name.underscore,
document_type: "worldwide_organisation",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this okay? I was in the middle of changing Publishing API, and I wondering if we actually needed these to be different? We can distinguish the old ones from new through the base path instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could revert this if this is okay alphagov/publishing-api#2578

If not, happy to add in the editionable_worldwide_organisation to the schema types.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably fine to keep both editionable and non-editionable as having the same document type, since the same code will be rendering both versions.

Comment on lines 75 to 77
def title
name
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be done with alias_method? E.g. alias_method :title :name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this 👍

},
},
document_type: item.class.name.underscore,
document_type: "worldwide_organisation",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably fine to keep both editionable and non-editionable as having the same document type, since the same code will be rendering both versions.

Copy link
Member

@brucebolt brucebolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me 👍. Just added a couple of non-blocking comments.

The new editionable worldwide organisation model uses the `title` method
instead of `name`.

This adds `title` to the legacy worldwide organisation model so that views and
helpers etc. can be compatible with both model types.
We don't need a new document type here, we can use the existing one.
This is required for editionable worldwide organisations.
These have been broken for some time. They remained broken when the rendering
of these pages was moved to Government Frontend.

Presenting these correctly will allow us to fix them on the frontend and
restore their proper functionality.
The presenter isn't currently valid against the schema because it's missing the
logo formatted name.
This allows users to add a logo formatted name for the new editionable
worldwide organisations.
@jkempster34 jkempster34 merged commit 94d5cdc into main Jan 2, 2024
20 checks passed
@jkempster34 jkempster34 deleted the ww-org-logo-formatted-name branch January 2, 2024 09:58
brucebolt added a commit to alphagov/publishing-api that referenced this pull request Jan 2, 2024
In alphagov/whitehall#8684, we fixed the
presenter for Worldwide Organisations to correctly include the HTML for
formatted titles on Worldwide Organisation pages.

This updates the example to match.
brucebolt added a commit to alphagov/publishing-api that referenced this pull request Jan 2, 2024
In alphagov/whitehall#8684, we fixed the
presenter for Worldwide Organisations to correctly include the HTML for
formatted titles on Worldwide Organisation pages.

This updates the example to match.
brucebolt added a commit to alphagov/publishing-api that referenced this pull request Jan 2, 2024
In alphagov/whitehall#8684, we fixed the
presenter for Worldwide Organisations to correctly include the HTML for
formatted titles on Worldwide Organisation pages.

This updates the example to match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants